﻿using UnityEngine;
using System.Collections;

/// <summary>
/// BOSS状态机
/// </summary>
public class BossSTM : MonoBehaviour {


    public int status = GameConfig.BOSS_STM_NORMAL;

    public delegate void BossEvent();

    public event BossEvent onCrazy = null;

	// Use this for initialization
	void Start () {
        Entity entity = GetComponent<Entity>();

        entity.onHurt += delegate (object damage)
        {

            if (entity.getCurrentHP() <= entity.totalHP/6.0f) {
                status = GameConfig.BOSS_STM_CRAZY;
                if (onCrazy != null)
                    onCrazy.Invoke();
            }
        };
	}
	
	// Update is called once per frame
	void Update () {
	
	}
}
